import requests
from bs4 import BeautifulSoup
import re

# 请求URL
url = "https://mp.weixin.qq.com/s?__biz=MzI3NDI5MjI4OQ==&amp;mid=2247811080&amp;idx=1&amp;sn=3000227654b4268af817fa09b7e1bee1&amp;chksm=eb180b26dc6f82307ea1b07a5987bbf57164d21b06922366d3b955f79a42fc35292282c6a927&amp;scene=231&amp;subscene=7&amp;clicktime=1729086917&amp;enterid=1729086917&amp;sessionid=0&amp;ascene=3&amp;fasttmpl_type=0&amp;fasttmpl_fullversion=7429186-zh_CN-zip&amp;fasttmpl_flag=0&amp;realreporttime=1729086917803#rd"
payload = {}
headers = {
    'User-Agent': 'Apifox/1.0.0 (https://apifox.com)',
    'Cookie': 'iip=0; ptcz=ac30922cecdbe0e49f2d9934134861088420f38df83d3aaaa404330198341274; ua_id=tEIPH7z6nijAfIWMAAAAAKtIuJreZfKJ4l-UEeY-Mkg=; mm_lang=zh_CN; pgv_pvid=4099109658; _qimei_uuid42=17c130d0f201000d8af508af58f157f636d67094dd; _qimei_fingerprint=ad2f4eaf4eb6be177c3055f482ed9444; _qimei_q36=; _qimei_h38=8f95dee68af508af58f157f602000005e17c13; pac_uid=1_1478609429; eas_sid=a1Z7S0r494W2h5A5T4f6U1k6J6; xid=028d85432efea389ab031c80b28ea522; _clck=3920398528|1|fmc|0; poc_sid=HJpxD2ejLRQeaC4W5_osOOYMc-9GC5atO2z58bSr; rewardsn=; wxtokenkey=777'
}

response = requests.request("GET", url, headers=headers, data=payload)

# 解析HTML内容
soup = BeautifulSoup(response.text, 'html.parser')

# 提取中文文本
chinese_text = soup.get_text()
chinese_text = re.sub(r'[^\u4e00-\u9fff]+', ' ', chinese_text).strip()

# 提取图片链接
img_tags = soup.find_all('img')
img_urls = [img['src'] for img in img_tags if 'src' in img.attrs]

# 打印结果
print("中文文本:")
print(chinese_text)
print("\n图片链接:")
for img_url in img_urls:
    print(img_url)
